<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
 
	  <composite:interface>
			<composite:attribute name="type" default="Global" />
			<composite:attribute name="communityId"/>
	  </composite:interface>
 
	  <composite:implementation>
	  <p:panel id="activityStreamPanel">
			
	  	<c:if test="#{activityBean.isLoggedIn()}">
	  		
			<h:form id="ActivityStream">
	 			<p:inputText id="newActivityText" value="#{activityBean.newActivityText}"></p:inputText>
	 			<p:commandButton id="addActivity" value="Add" actionListener="#{activityBean.newActivtiy()}" icon="ui-icon-disk" ajax="true" update="addedActivities"/>
	 	 		<p:dataTable id="addedActivities" var="activity" value="#{activityBean.activities}">
					<p:column>
						<div>
							<h:outputText value="#{activity.creator.firstName}" style="font-size:0.7em"/> 
							<h:outputText value=" " /> 
							<h:outputText value="#{activity.creator.lastName}" style="font-size:0.7em"/> 
							<h:outputText value=" " /> 
		 					<h:outputText value="#{activity.timestamp}" style="font-size:0.5em"/> 
		 					<h:outputText value=" " /> 
		 					<h:outputText value="#{activity.type}" style="font-size:0.5em"/> 
	 					</div>
	 					<h:outputText id="addedActivityText" value="#{activity.text}" /> 
	 				</p:column>
	 					
	 				<p:column>
	 					<p:commandButton actionListener="#{activityBean.removeActivity(activity)}" icon="ui-icon-closethick" ajax="false" update="addedActivities" rendered="#{activityBean.isDeleteable(activity)}"/>
	 				</p:column>	 				
	 			</p:dataTable>
			</h:form>
		</c:if>
	  </p:panel>  
	  </composite:implementation>
</html>